<template>
  <div class="articleitem">
    <van-cell :to="'/detail/'+row.art_id" :title="row.title">
      <!-- 自定义右侧 -->
      <template v-if="row.cover.type===1">
        <van-image

        class="right-img"
          width="100"
          height="100"
          :src="row.cover.images[0]"
        />
      </template>

      <!-- 自定义lable -->
      <template #label>
        <div class='img-box' v-if="row.cover.type===3">
            <van-image
            v-for='(item,index) in row.cover.images'
            :key="index"
          width="100"
          height="100"
          :src="item"
        />
        </div>
        <span>{{row.aut_name}}</span>
        <span class="comment-num">{{row.collect_count}}评论</span>
        <span>{{row.pubdate | relativeTime}}</span>
      </template>
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'articleitem',
  props: {
    row: {
      type: Object,
      require: true
    }
  },
  data () {
    return {}
  },

  created () {},

  methods: {}
}
</script>

<style scoped lang="less">
.articleitem {
  .comment-num {
    margin: 0 15px;
  }
  .img-box{
    display: flex;
    justify-content: space-between;
  }
  .right-img{
    width: 232px;
    height: 146px;
  }
}
</style>
